const express = require('express')
const app = express()
// function mock(app, url, data) {
//   app.get(url, (request, response) => {
//     console.log(response)
//     response.json(data)
//   })
// }
// const mockBookHomeData = require('./src/mock/bookHome')
// const mockBookShelfData = require('./src/utils/bookShelf')
// const mockBookList = require('./src/mock/bookCategoryList')
// const mockBookFlatList = require('./src/mock/bookFlatList')

module.exports = {
  // 部署生成环境和开发环境下的URL
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  devServer: {
    // before(app) {
    //   mock(app, '/book/home', mockBookHomeData)
    //   mock(app, '/book/shelf', mockBookShelfData)
    //   mock(app, '/book/list', mockBookList)
    //   mock(app, '/book/flat-list', mockBookFlatList)
    // }
  },
  // 解决警告
  configureWebpack: {
    performance: {
      hints: 'warning',
      maxAssetSize: 524288,
      maxEntrypointSize: 524288
    }
  }
}
